﻿<%@ WebHandler Language="C#" Class="DeleteProduct" %>

using System;
using System.Web;

public class DeleteProduct : AdminHandler
{

    public override void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        if (IsAuthenticate(context))
        {
            try
            {
                int pid = 0;
                if (context.Request.QueryString["pid"] != null)
                    pid = int.Parse(context.Request.QueryString["pid"].ToString());


                Product obj = new Product().UpdateStatusActive(pid, 0);
                context.Response.Write("OK");
            }
            catch (Exception ex)
            {
                PMSA.Framework.Log.CLogManager.Write("DeleteProduct.ashx", ex.ToString(), "ADMIN");
                context.Response.Write("FAIL");
            }  
        }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}